/**
 * Created by Yun on 2016-04-01.
 */

import {
  get,  post,  saveAccessToken,
} from './api';
import md5 from 'md5';
import {emit, subscribe} from '../utils/pubsub';

let userInfo = null;
let nowSendActiveEmailto = null;

let adminToken = "";

export async function adminLogin(mobile, pwd){

  var ret = await post('/admin/user/login', {
    mobile, pwd
  });

  var ok = 1;

  if (ret.ok){
    saveAccessToken(ret.token);
  }else{
    ok = 0;
  }

  return {
    ok,
    status: ret.status
  }

}